package com.ship.contract.controller;

import com.ship.common.core.base.BaseController;
import com.ship.common.core.web.domain.JsonResult;
import com.ship.contract.bean.ConLabel;
import com.ship.contract.service.ConLabelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 31463
 */
@RestController
@RequestMapping("/conLabel")
public class ConLabelController extends BaseController {

    @Autowired
    private ConLabelService conLabelService;

    /**
     * 查询所有
     * @return
     */
    @GetMapping("/list")
    public JsonResult<List<ConLabel>> getSystemLabel(){
        return JsonResult.success(conLabelService.list());
    }

    /**
     * 新增
     *
     * @param conLabel
     * @return
     */
    @PostMapping
    public JsonResult<Object> add(@RequestBody ConLabel conLabel) {
        conLabelService.saveCon(conLabel);
        return JsonResult.success();
    }

    /**
     * 修改
     *
     * @param conLabel
     * @return
     */
    @PutMapping
    public JsonResult<Object> update(@RequestBody ConLabel conLabel) {
        conLabelService.updateConLabel(conLabel);
        return JsonResult.success();
    }

}
